package com.kamistoat.meimeimall.common.constant;

public class PaymentConstant {
    /**
     * csv非数据头行数
     */
    public static final Integer BILL_CSV_SKIP_HEADLINE = 1;
    /**
     * csv分隔符
     */
    public static final String BILL_CSV_SPLIT = ",";
    /**
     * 向数据库清洗数据时，一次连接下清洗的最大记录数.
     * 十万条数据清洗到数据库的耗时为4秒
     */
    public static final Integer BILL_FLUSH_SINGLE_LIMIT = 100000;
    /**
     * 前缀
     */
    public static final String BILL_RECORD_PREFIX = "pms_bill_record_";
    /**
     * 前缀
     */
    public static final String PAYMENT_BILL_JOIN_PREFIX = "pms_payment_bill_join_";
    /**
     * 前缀
     */
    public static final String RECONCILIATION_ERROR_PREFIX = "pms_reconciliation_error_";
    /**
     * 对账时从关联大表中数据抽取
     */
    public static final Integer JOIN_TABLE_PAGE_SIZE = 50000;
    /**
     * join数据对账，线程任务量
     */
    public static final Integer JOIN_DATA_PERTHREAD_SIZE = 10000;

    public enum PaymentType {
        PAYMENT(0, "付款"),
        REFUND(1, "退款");

        private Integer code;
        private String message;

        PaymentType(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    public enum ReconciliationErrorType {
        LONGSIDE(1, "长款"),
        SHORTSIDE(2, "短款"),
        DISMATCH(3, "金额错误"),
        UNKNOWN(4, "未知错误");

        private Integer code;
        private String message;

        ReconciliationErrorType(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    public enum ReconciliationErrorHandleStatus {
        WAITING(0, "待处理"),
        AUTOHANDLE(1, "已自动处理"),
        MANUALHANDLE(2, "已手动处理");

        private Integer code;
        private String message;

        ReconciliationErrorHandleStatus(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    public enum ReconciliationTaskStatus {
        WAITING(0, "等待执行"),
        EXECUTING(1, "正在执行"),
        FINISHED(2, "执行成功");

        private Integer code;
        private String message;

        ReconciliationTaskStatus(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    public enum ReconciliationTaskErrorStatus {
        UNFINISH(2, "任务未结束"),
        NORMAL(0, "无错误"),
        ERRORS(1, "存在错误");

        private Integer code;
        private String message;

        ReconciliationTaskErrorStatus(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }
}
